<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/>
<title>servo.h File Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="../../vesc.jpg"/></td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.10 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="../../index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="../../pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="../../modules.html"><span>Modules</span></a></li>
      <li><a href="../../annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="../../files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="../../search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="../../search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="../../files.html"><span>File&#160;List</span></a></li>
      <li><a href="../../globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<div class="title">servo.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;ch.h&quot;</code><br />
<code>#include &quot;hal.h&quot;</code><br />
<code>#include &quot;<a class="el" href="../../db/dae/hw_8h_source.html">hw.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="../../df/df4/conf__general_8h_source.html">conf_general.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="../../d3/d26/stm32f4xx__conf_8h_source.html">stm32f4xx_conf.h</a>&quot;</code><br />
</div>
<p><a href="../../de/d09/servo_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d3e/struct_s_e_r_v_o.html">SERVO</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a11643f271076024c395a93800b3d9546"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d09/servo_8h.html#a11643f271076024c395a93800b3d9546">_BV</a>(bit)&#160;&#160;&#160;(1 &lt;&lt; (bit))</td></tr>
<tr class="separator:a11643f271076024c395a93800b3d9546"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3acffbd305ee72dcd4593c0d8af64a4f"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d09/servo_8h.html#a3acffbd305ee72dcd4593c0d8af64a4f">MIN</a>(a,  b)&#160;&#160;&#160;(((a)&lt;(b))?(a):(b))</td></tr>
<tr class="separator:a3acffbd305ee72dcd4593c0d8af64a4f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afa99ec4acc4ecb2dc3c2d05da15d0e3f"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d09/servo_8h.html#afa99ec4acc4ecb2dc3c2d05da15d0e3f">MAX</a>(a,  b)&#160;&#160;&#160;(((a)&gt;(b))?(a):(b))</td></tr>
<tr class="separator:afa99ec4acc4ecb2dc3c2d05da15d0e3f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5b4b344e1037b7fa2fb65cb9f23b1e31"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d09/servo_8h.html#a5b4b344e1037b7fa2fb65cb9f23b1e31">SERVOS_NUM</a>&#160;&#160;&#160;<a class="el" href="../../d9/d16/hw__victor__r1a_8h.html#a8fbbc12019e6b0ef94174d1d600a8276">HW_SERVO_NUM</a></td></tr>
<tr class="separator:a5b4b344e1037b7fa2fb65cb9f23b1e31"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ace92cc68842421d2dba0bf77f5c06b3e"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d09/servo_8h.html#ace92cc68842421d2dba0bf77f5c06b3e">SERVO_CNT_SPEED</a>&#160;&#160;&#160;1000000L</td></tr>
<tr class="separator:ace92cc68842421d2dba0bf77f5c06b3e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a35b88eb1fce676679825b9738a67272c"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d09/servo_8h.html#a35b88eb1fce676679825b9738a67272c">S_STARTPULSE</a>&#160;&#160;&#160;<a class="el" href="../../df/df4/conf__general_8h.html#aceae775b605ad97b91d11c48efa165b7">SERVO_OUT_PULSE_MIN_US</a></td></tr>
<tr class="separator:a35b88eb1fce676679825b9738a67272c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af038a616d759732cc1d2be0fbc3cb94b"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d09/servo_8h.html#af038a616d759732cc1d2be0fbc3cb94b">S_PULSELEN</a>&#160;&#160;&#160;(<a class="el" href="../../df/df4/conf__general_8h.html#aab1ccffb4f17970e303970fcb96b2020">SERVO_OUT_PULSE_MAX_US</a> - <a class="el" href="../../df/df4/conf__general_8h.html#aceae775b605ad97b91d11c48efa165b7">SERVO_OUT_PULSE_MIN_US</a>)</td></tr>
<tr class="separator:af038a616d759732cc1d2be0fbc3cb94b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af88ff96914d3f073b65045084d661c4e"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d09/servo_8h.html#af88ff96914d3f073b65045084d661c4e">S_COOLDOWN</a>&#160;&#160;&#160;(1000000 / <a class="el" href="../../df/df4/conf__general_8h.html#a8ce08a27ce10ba22bc9ef7b3be74d277">SERVO_OUT_RATE_HZ</a>)</td></tr>
<tr class="separator:af88ff96914d3f073b65045084d661c4e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a376a42bdd5ff453c7aec5fe1bc1f10b9"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d09/servo_8h.html#a376a42bdd5ff453c7aec5fe1bc1f10b9">SERVO_START_OFFSET</a>&#160;&#160;&#160;(<a class="el" href="../../de/d09/servo_8h.html#ace92cc68842421d2dba0bf77f5c06b3e">SERVO_CNT_SPEED</a> / (1000000L / S_STARTPULSE))</td></tr>
<tr class="separator:a376a42bdd5ff453c7aec5fe1bc1f10b9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a39c1c90ff1d3117fdd72af4ffa69c1c1"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d09/servo_8h.html#a39c1c90ff1d3117fdd72af4ffa69c1c1">SERVO_CPU_FACTOR</a>&#160;&#160;&#160;((<a class="el" href="../../de/d09/servo_8h.html#ace92cc68842421d2dba0bf77f5c06b3e">SERVO_CNT_SPEED</a> + ((1000000L / S_PULSELEN) * 256L) - 1L) / ((1000000L / S_PULSELEN) * 256L))</td></tr>
<tr class="separator:a39c1c90ff1d3117fdd72af4ffa69c1c1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abfba947e62f306dc1e3bddd52e919c16"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d09/servo_8h.html#abfba947e62f306dc1e3bddd52e919c16">SERVO_COOLDOWN_FACTOR</a>&#160;&#160;&#160;(<a class="el" href="../../de/d09/servo_8h.html#ace92cc68842421d2dba0bf77f5c06b3e">SERVO_CNT_SPEED</a> / (1000000L / S_COOLDOWN))</td></tr>
<tr class="separator:abfba947e62f306dc1e3bddd52e919c16"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4c9e0256311a127b25b74d6e289d35ed"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d09/servo_8h.html#a4c9e0256311a127b25b74d6e289d35ed">USE_COMMANDS</a>&#160;&#160;&#160;0</td></tr>
<tr class="separator:a4c9e0256311a127b25b74d6e289d35ed"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acd8242192c747155106d69a8dab670a6"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d09/servo_8h.html#acd8242192c747155106d69a8dab670a6">TEST_CYCLE_TIME</a>&#160;&#160;&#160;0</td></tr>
<tr class="separator:acd8242192c747155106d69a8dab670a6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a27e8e86651c3cda4787bc9cce95ca4f1"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d09/servo_8h.html#a27e8e86651c3cda4787bc9cce95ca4f1">ACTUAL_POS</a>(servo)&#160;&#160;&#160;(<a class="el" href="../../de/d09/servo_8h.html#afa99ec4acc4ecb2dc3c2d05da15d0e3f">MAX</a>(<a class="el" href="../../de/d09/servo_8h.html#a3acffbd305ee72dcd4593c0d8af64a4f">MIN</a>(servo.pos + (signed short)servo.offset, 255), 0))</td></tr>
<tr class="separator:a27e8e86651c3cda4787bc9cce95ca4f1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0281665406c147f639401f3eeddd403f"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d09/servo_8h.html#a0281665406c147f639401f3eeddd403f">ACTUAL_POS_PTR</a>(servo)&#160;&#160;&#160;(<a class="el" href="../../de/d09/servo_8h.html#afa99ec4acc4ecb2dc3c2d05da15d0e3f">MAX</a>(<a class="el" href="../../de/d09/servo_8h.html#a3acffbd305ee72dcd4593c0d8af64a4f">MIN</a>(servo-&gt;pos + (signed short)servo-&gt;offset, 255), 0))</td></tr>
<tr class="separator:a0281665406c147f639401f3eeddd403f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad530a6cb51cef3e738eff2aab061d485"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d09/servo_8h.html#ad530a6cb51cef3e738eff2aab061d485">CMD_MS_TO_VAL</a>(ms)&#160;&#160;&#160;((ms) / (((<a class="el" href="../../de/d09/servo_8h.html#a35b88eb1fce676679825b9738a67272c">S_STARTPULSE</a> + <a class="el" href="../../de/d09/servo_8h.html#af038a616d759732cc1d2be0fbc3cb94b">S_PULSELEN</a> + <a class="el" href="../../de/d09/servo_8h.html#af88ff96914d3f073b65045084d661c4e">S_COOLDOWN</a>) * CMD_WAIT_FACTOR) / 1000))</td></tr>
<tr class="separator:ad530a6cb51cef3e738eff2aab061d485"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abe965d86ae54d7d49cf7d38e945afd19"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d09/servo_8h.html#abe965d86ae54d7d49cf7d38e945afd19">SERVO_PERIOD_TIME_MS</a>&#160;&#160;&#160;((<a class="el" href="../../de/d09/servo_8h.html#a35b88eb1fce676679825b9738a67272c">S_STARTPULSE</a> + <a class="el" href="../../de/d09/servo_8h.html#af038a616d759732cc1d2be0fbc3cb94b">S_PULSELEN</a> + <a class="el" href="../../de/d09/servo_8h.html#af88ff96914d3f073b65045084d661c4e">S_COOLDOWN</a>) / 1000)</td></tr>
<tr class="separator:abe965d86ae54d7d49cf7d38e945afd19"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a32befddd5759ec16ab7964d78e2252c5"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d09/servo_8h.html#a32befddd5759ec16ab7964d78e2252c5">servo_init</a> (void)</td></tr>
<tr class="separator:a32befddd5759ec16ab7964d78e2252c5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a32699c625d5d389a417c90057232ff35"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d09/servo_8h.html#a32699c625d5d389a417c90057232ff35">servo_stop_driver</a> (void)</td></tr>
<tr class="separator:a32699c625d5d389a417c90057232ff35"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2a1bd6b05e410ad098c24e44a2793b88"><td class="memItemLeft" align="right" valign="top">unsigned char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d09/servo_8h.html#a2a1bd6b05e410ad098c24e44a2793b88">servo_driver_is_active</a> (void)</td></tr>
<tr class="separator:a2a1bd6b05e410ad098c24e44a2793b88"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aff30b246975c4fa2f36ab697e69ca3b8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d09/servo_8h.html#aff30b246975c4fa2f36ab697e69ca3b8">servo_irq</a> (void)</td></tr>
<tr class="separator:aff30b246975c4fa2f36ab697e69ca3b8"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:ae5f20028c2a7c8e5db512d342e409d4b"><td class="memItemLeft" align="right" valign="top">volatile <a class="el" href="../../da/d3e/struct_s_e_r_v_o.html">SERVO</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d09/servo_8h.html#ae5f20028c2a7c8e5db512d342e409d4b">servos</a> [<a class="el" href="../../de/d09/servo_8h.html#a5b4b344e1037b7fa2fb65cb9f23b1e31">SERVOS_NUM</a>]</td></tr>
<tr class="separator:ae5f20028c2a7c8e5db512d342e409d4b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="a11643f271076024c395a93800b3d9546"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define _BV</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">bit</td><td>)</td>
          <td>&#160;&#160;&#160;(1 &lt;&lt; (bit))</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a27e8e86651c3cda4787bc9cce95ca4f1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define ACTUAL_POS</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">servo</td><td>)</td>
          <td>&#160;&#160;&#160;(<a class="el" href="../../de/d09/servo_8h.html#afa99ec4acc4ecb2dc3c2d05da15d0e3f">MAX</a>(<a class="el" href="../../de/d09/servo_8h.html#a3acffbd305ee72dcd4593c0d8af64a4f">MIN</a>(servo.pos + (signed short)servo.offset, 255), 0))</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a0281665406c147f639401f3eeddd403f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define ACTUAL_POS_PTR</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">servo</td><td>)</td>
          <td>&#160;&#160;&#160;(<a class="el" href="../../de/d09/servo_8h.html#afa99ec4acc4ecb2dc3c2d05da15d0e3f">MAX</a>(<a class="el" href="../../de/d09/servo_8h.html#a3acffbd305ee72dcd4593c0d8af64a4f">MIN</a>(servo-&gt;pos + (signed short)servo-&gt;offset, 255), 0))</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="ad530a6cb51cef3e738eff2aab061d485"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define CMD_MS_TO_VAL</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">ms</td><td>)</td>
          <td>&#160;&#160;&#160;((ms) / (((<a class="el" href="../../de/d09/servo_8h.html#a35b88eb1fce676679825b9738a67272c">S_STARTPULSE</a> + <a class="el" href="../../de/d09/servo_8h.html#af038a616d759732cc1d2be0fbc3cb94b">S_PULSELEN</a> + <a class="el" href="../../de/d09/servo_8h.html#af88ff96914d3f073b65045084d661c4e">S_COOLDOWN</a>) * CMD_WAIT_FACTOR) / 1000))</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="afa99ec4acc4ecb2dc3c2d05da15d0e3f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MAX</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">a, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">b&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;(((a)&gt;(b))?(a):(b))</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a3acffbd305ee72dcd4593c0d8af64a4f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MIN</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">a, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">b&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;(((a)&lt;(b))?(a):(b))</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="af88ff96914d3f073b65045084d661c4e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define S_COOLDOWN&#160;&#160;&#160;(1000000 / <a class="el" href="../../df/df4/conf__general_8h.html#a8ce08a27ce10ba22bc9ef7b3be74d277">SERVO_OUT_RATE_HZ</a>)</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="af038a616d759732cc1d2be0fbc3cb94b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define S_PULSELEN&#160;&#160;&#160;(<a class="el" href="../../df/df4/conf__general_8h.html#aab1ccffb4f17970e303970fcb96b2020">SERVO_OUT_PULSE_MAX_US</a> - <a class="el" href="../../df/df4/conf__general_8h.html#aceae775b605ad97b91d11c48efa165b7">SERVO_OUT_PULSE_MIN_US</a>)</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a35b88eb1fce676679825b9738a67272c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define S_STARTPULSE&#160;&#160;&#160;<a class="el" href="../../df/df4/conf__general_8h.html#aceae775b605ad97b91d11c48efa165b7">SERVO_OUT_PULSE_MIN_US</a></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="ace92cc68842421d2dba0bf77f5c06b3e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SERVO_CNT_SPEED&#160;&#160;&#160;1000000L</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="abfba947e62f306dc1e3bddd52e919c16"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SERVO_COOLDOWN_FACTOR&#160;&#160;&#160;(<a class="el" href="../../de/d09/servo_8h.html#ace92cc68842421d2dba0bf77f5c06b3e">SERVO_CNT_SPEED</a> / (1000000L / S_COOLDOWN))</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a39c1c90ff1d3117fdd72af4ffa69c1c1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SERVO_CPU_FACTOR&#160;&#160;&#160;((<a class="el" href="../../de/d09/servo_8h.html#ace92cc68842421d2dba0bf77f5c06b3e">SERVO_CNT_SPEED</a> + ((1000000L / S_PULSELEN) * 256L) - 1L) / ((1000000L / S_PULSELEN) * 256L))</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="abe965d86ae54d7d49cf7d38e945afd19"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SERVO_PERIOD_TIME_MS&#160;&#160;&#160;((<a class="el" href="../../de/d09/servo_8h.html#a35b88eb1fce676679825b9738a67272c">S_STARTPULSE</a> + <a class="el" href="../../de/d09/servo_8h.html#af038a616d759732cc1d2be0fbc3cb94b">S_PULSELEN</a> + <a class="el" href="../../de/d09/servo_8h.html#af88ff96914d3f073b65045084d661c4e">S_COOLDOWN</a>) / 1000)</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a376a42bdd5ff453c7aec5fe1bc1f10b9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SERVO_START_OFFSET&#160;&#160;&#160;(<a class="el" href="../../de/d09/servo_8h.html#ace92cc68842421d2dba0bf77f5c06b3e">SERVO_CNT_SPEED</a> / (1000000L / S_STARTPULSE))</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a5b4b344e1037b7fa2fb65cb9f23b1e31"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SERVOS_NUM&#160;&#160;&#160;<a class="el" href="../../d9/d16/hw__victor__r1a_8h.html#a8fbbc12019e6b0ef94174d1d600a8276">HW_SERVO_NUM</a></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="acd8242192c747155106d69a8dab670a6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define TEST_CYCLE_TIME&#160;&#160;&#160;0</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a4c9e0256311a127b25b74d6e289d35ed"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define USE_COMMANDS&#160;&#160;&#160;0</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a2a1bd6b05e410ad098c24e44a2793b88"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned char servo_driver_is_active </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a32befddd5759ec16ab7964d78e2252c5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void servo_init </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="aff30b246975c4fa2f36ab697e69ca3b8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void servo_irq </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a32699c625d5d389a417c90057232ff35"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void servo_stop_driver </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
<a class="anchor" id="ae5f20028c2a7c8e5db512d342e409d4b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">volatile <a class="el" href="../../da/d3e/struct_s_e_r_v_o.html">SERVO</a> servos[<a class="el" href="../../de/d09/servo_8h.html#a5b4b344e1037b7fa2fb65cb9f23b1e31">SERVOS_NUM</a>]</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
</div><!-- contents -->
<hr class="footer"/><address class="footer"><small>
Generated by <a href="https://github.com/joshdellay" target="_new">Josh Dellay</a>